<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/10/11
  Time: 10:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all">
<style>
    body{
        background-color: rgb(242,242,242);
        padding: 15px;
    }
    .div-content{

        background-color: white;
        border-radius: 10px;
        padding: 15px;
    }
    fieldset{
        margin: 0;
        border: 1px solid #e6e6e6;
        padding: 10px 20px 5px 20px;
        color: #6b6b6b;
        border-radius: 10px;
    }
</style>
<body>
<script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>

<form  class="layui-form" lay-filter="dataform" id="dataform" method="post">
    <input type="hidden" name="orderId" value="${order.orderId}" />
    <div class="layui-form-item">
        <label class="layui-form-label">订单编码</label>
        <div class="layui-input-block">
            <input type="text" name="orderNum" value="${order.orderNum}" readonly autocomplete="off" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">订单时间</label>
        <div class="layui-input-block">
            <input type="text" name="orderDate" value="<fmt:formatDate value='${order.orderDate}' pattern='yyyy-MM-dd HH:mm:ss'/>" readonly  autocomplete="off" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input type="text" name="client.clientName" id="clientName" value="${order.client.clientName}" required  autocomplete="off" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-block">
            <input type="text" name="client.phone" value="${order.client.phone}" readonly  autocomplete="off" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份证</label>
        <div class="layui-input-block">
            <input type="text" name="client.idCard" value="${order.client.idCard}" readonly  autocomplete="off" class="layui-input"/>
        </div>
    </div>
<%--    <div class="layui-form-item">--%>
<%--        <label class="layui-form-label">房间类型</label>--%>
<%--        <div class="layui-input-block">--%>
<%--           <select name="room.typeName" id="typeName" readonly class="layui-select">--%>
<%--               <option readonly value="${order.room.typeName}">${order.room.typeName}</option>--%>
<%--               <option value="单人间">单人间</option>--%>
<%--               <option value="双人间">双人间 </option>--%>
<%--               <option value="海景房">海景房</option>--%>
<%--               <option value="总统套房">总统套房</option>--%>
<%--               <option value="情侣房">情侣房</option>--%>
<%--               <option value="麻将房">麻将房</option>--%>
<%--               <option value="豪华套间">豪华套间</option>--%>
<%--               <option value="电竞房">电竞房</option>--%>
<%--               <option value="大床房">大床房</option>--%>
<%--               <option value="商务间">商务间</option>--%>
<%--            </select>--%>
<%--        </div>--%>
<%--    </div>--%>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit=""
                    lay-filter="dosubmit" id="dosubmit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    layui.use([ "element", "jquery", "layer", "form", "table" ], function(){

        var $ = layui.$;
        var form = layui.form;

        form.on('submit(dosubmit)',function (data) {
            let url='${pageContext.request.contextPath}/update'
            $.post(url,data.field,function (response) {
                if(response.code==0){
                    layer.msg('修改成功',{
                        icon:1,
                        time:2000
                    },function () {
                        var index=parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        parent.reload()
                    })
                }else {
                    alert('失败')
                }
            })
            return false;
        });

    });



</script>
</body>
</html>
